# Maintainer: Daniel M. Capella <polyzen@archlinux.org>

_name=BLAKE3
pkgname=b3sum
pkgver=1.5.0
pkgrel=1
pkgdesc='Command line implementation of the BLAKE3 hash function'
arch=('loong64' 'x86_64')
url=https://github.com/BLAKE3-team/BLAKE3
license=('Apache')
depends=('gcc-libs')
makedepends=('git' 'rust')
source=("git+$url.git#tag=$pkgver")
b2sums=('SKIP')

prepare() {
  cd $_name/$pkgname
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd $_name/$pkgname
  cargo build --release --locked --offline
}

check() {
  cd $_name/$pkgname
  cargo test --locked --offline
}

package() {
  cd $_name/$pkgname
  install -Dt "$pkgdir"/usr/bin target/release/$pkgname
}
